import {get, post} from "./axios"

// 商品分类列表
const giftSortList = async function(data) {
    const url = `/admin/giftSort/list`
    return await get(url, data)
}

// 编辑分类
const giftSortEdit = async function(data) {
    const url = `/admin/giftSort/edit`
    return await post(url, data)
}

// 编辑分类
const giftSortAdd = async function(data) {
    const url = `/admin/giftSort/add`
    return await post(url, data)
}

// 编辑分类
const giftSortDel = async function(data) {
    const url = `/admin/giftSort/batchEdit`
    return await post(url, data)
}

// 礼品列表
const getGiftList = async function(data) {
    const url = `/admin/Gift/list`
    return await get(url, data)
}

// 添加礼品
const addGoods = async function(data) {
    const url = `/admin/gift/add`
    return await post(url, data)
}

// 编辑礼品
const editGoods = async function(data) {
    const url = `/admin/Gift/edit`
    return await post(url, data)
}

// 根据id获取礼品
const findGoods = async function(data) {
    const url = `/admin/Gift/find`
    return await get(url, data)
}

// 删除礼品
const delGoods = async function(data) {
    const url = `/admin/Gift/batchEdit`
    return await post(url, data)
}

// 仓库列表
const warehouseList = async function(data) {
    const url = `/admin/warehouse/list`
    return await get(url, data)
}

// 仓库添加
const addWarehouse = async function(data) {
    const url = `/admin/warehouse/add`
    return await post(url, data)
}

// 编辑仓库仓库
const editWarehouse = async function(data) {
    const url = `/admin/Warehouse/edit`
    return await post(url, data)
}

// 根据id查询仓库
const findWarehouse = async function(data) {
    const url = `/admin/warehouse/find`
    return await post(url, data)
}

// 获取礼品列表 商品管理-创建采购的选择商品
const giftList = async function(data) {
    const url = `/admin/gift/getGiftlist`
    return await post(url, data)
}

// 采购
const procurement = async function(data) {
    const url = `/admin/giftBill/procurement`
    return await post(url, data)
}

// 出库
const delivery = async function(data) {
    const url = `/admin/giftBill/delivery`
    return await post(url, data)
}

// 调拨
const allocate = async function(data) {
    const url = `/admin/giftBill/allocate`
    return await post(url, data)
}

// 根据仓库id获取礼品列表 出库和调拨的统一接口
const warehouseGetGift = async function(data) {
    const url = `/admin/warehouse/getGift`
    return await post(url, data)
}
// 根据仓库id获取礼品列表 采购的接口
const getGiftProcurement = async function(data) {
    const url = `/admin/gift/getGiftlist`
    return await post(url, data)
}

// 采购列表
const procurementList = async function(data) {
    const url = `/admin/giftBill/procurementList`
    return await get(url, data)
}

// 库单审核,导出
const procurementVerify = async function(data) {
    const url = `/admin/giftBill/procurementVerify`
    return await get(url, data)
}

// 库单流水,导出
const giftBillLogs = async function(data) {
    const url = `/admin/giftBill/logs`
    return await get(url, data)
}

// 设置礼品签约
const setSign = async function(data) {
    const url = `/admin/Gift/setSign`
    return await get(url, data)
}

// 商品出入列表
const giftsList = async function(data) {
    const url = `/admin/giftBill/giftsList`
    return await get(url, data)
}

// 商品出入列表单个的
const giftBillGift = async function(data) {
    const url = `/admin/giftBill/gift`
    return await get(url, data)
}

export {
    giftSortList,
    giftSortEdit,
    giftSortAdd,
    giftSortDel,
    getGiftList,
    addGoods,
    editGoods,
    delGoods,
    findGoods,
    warehouseList,
    addWarehouse,
    editWarehouse,
    findWarehouse,
    giftList,
    procurement,
    delivery,
    allocate,
    warehouseGetGift,
    getGiftProcurement,
    procurementList,
    procurementVerify,
    giftBillLogs,
    setSign,
    giftsList,
    giftBillGift
}
